<template>
  <appHeader :name="route.meta.name"></appHeader>
  <router-view></router-view>
</template>

<script setup>
import {ref} from 'vue'

import { useRoute } from "vue-router";
const route = useRoute()

import appHeader from '@/components/app-header.vue';

import { loginApi,getUserInfoApi2 } from '@/api'

// 登录 测试数据 
const token=ref('')
const login = async () => {
  let {code,token} = await loginApi({
    username: 'dick',
    password: '1121212'
  })
  if(code==200){
    localStorage.setItem('token',token)
  }
  console.log(code,token, 'userData');
}
login()

// 获取user信息 me
const userInfo=ref({})
const getUserInfo=async()=>{
  let data=await getUserInfoApi2()
  console.log(data,'pppp');
}
getUserInfo()
</script>

<style lang="scss" scoped></style>